package views;

import java.awt.Dimension;
import java.awt.FlowLayout;
import java.awt.GraphicsDevice;
import java.awt.GraphicsEnvironment;
import java.awt.GridBagConstraints;
import java.awt.GridBagLayout;

import javax.swing.JFrame;
import javax.swing.JPanel;

import controllers.Game;


@SuppressWarnings("serial")
public class Screen extends JFrame {
	
	
	public Screen(String name){
		super(name);
		

		setSize(Game.WIDTH, Game.HEIGHT);
		this.setVisible(true);		
		
	}

	public void addAsPanel(JPanel panel) {
		
		
		panel.setMinimumSize(new Dimension(Game.WIDTH, Game.HEIGHT));
		panel.setMaximumSize(new Dimension(Game.WIDTH, Game.HEIGHT));
		panel.setPreferredSize(new Dimension(Game.WIDTH, Game.HEIGHT));
		
		
		this.getContentPane().add(panel);
		this.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
		
	
		this.add(panel);

		this.pack();
		this.setResizable(false);
		this.setLocationRelativeTo(null);
		
		panel.requestFocusInWindow();
		
	}

}
